{extend  name="manage@public/layout" /}
{block name="style"}
<link href="/static/css/plugins/chosen/chosen.css" rel="stylesheet">
<link href="/static/css/style.min.css" rel="stylesheet">
<style>
.mini-navbar{background: white;}
.form-group{height: 34px;}
.form-group label{float: left;clear:both;text-align: right;}
</style>
{/block}
{block name="content"}
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <input type="hidden" value="{$info.id}" name="w_id" />
            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商户</label>
                <div class="col-sm-4">
                    <select id="mch" class="chosen-select form-control" style="width:260px;" tabindex="2">
                        <option value="0">请选择商户</option>
                        {volist name="mch" id="vo"}
                        <option value="{$vo.mch}" {eq name="info['mch_id']" value="$vo.mch"}selected{/eq} >{$vo.mch}[{$vo.mch_name}]</option>
                        
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div style="height:75px !important;" class="form-group">
                <label class="col-sm-3 control-label">IP</label>
                <div class="col-sm-5">
                    <textarea class="input-sm form-control" rows="3" cols="30" placeholder="多个IP用|隔开" id="white_ip" name="white_ip">{$info.white_ip}</textarea>
                    <span style="position: absolute;color: red;right: -75px; top: 30px;">*多个IP用|隔开</span>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div style="height:75px !important;" class="form-group">
                <label class="col-sm-3 control-label">备注</label>
                <div class="col-sm-5">
                    <textarea class="input-sm form-control" rows="3" cols="30" placeholder="备注" id="remark" name="remark">{$info.remark}</textarea>
                </div>
            </div>
           
            <div style="text-align: center;" class="modal-footer">
                <button class="btn btn-primary btn-white-ip btn-mch">确定</button>
            </div>
        </div>
    </div>
    {/block}
    {block name="script"}
<script src="/static/js/plugins/chosen/chosen.jquery.js"></script>
<script>
    //模糊搜索
    $('.chosen-select').chosen({
        search_contains: true,
    });
    //编辑
    $(".btn-white-ip").click(function(){
        white_ip =  $("#white_ip").val();
        w_id =  $("input[name='w_id']").val();
        remark   = $("#remark").val();
        mch   = $("#mch option:selected").val();
        iframe = parent.layer.getFrameIndex(window.name);
        $.post("/manage/withdrawal_ip_save",{w_id:w_id,type:1,white_ip:white_ip,mch_id:mch,remark:remark},function(result){
            parent.layer.msg(result.msg);
            parent.layer.close(iframe); //关闭iframe层
            setTimeout(function() {
                window.location.reload();
            }, 1000)
        })
    })
</script>
 {/block}